package com.slicktechnologies.shared.common.productlayer;
import com.google.gwt.core.shared.GwtIncompatible;
import com.googlecode.objectify.annotation.Embed;
import com.googlecode.objectify.annotation.Entity;
import com.googlecode.objectify.annotation.EntitySubclass;
import com.googlecode.objectify.annotation.OnLoad;
import com.googlecode.objectify.annotation.OnSave;
import com.googlecode.objectify.annotation.Serialize;
import com.simplesoftwares.client.library.helperconstants.FormTypes;
import com.simplesoftwares.rebind.annatonations.TableAnnotation;
import com.slicktechnologies.client.config.configurations.ConfigTypes;
import com.slicktechnologies.shared.MyUtility;

// TODO: Auto-generated Javadoc
/**
 * Represents service product each product has duration and number of services.
 * class is designed such that duration's unit is undefined(it can be yearly, monthly,hourly)
 */
@EntitySubclass(index=true)
@Embed
public class ServiceProduct extends SuperProduct 
{
	
	/** *********************************************Entity Attributes***************************************************. */
	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1003665740505929790L;
	
	/** The no. of services  */
	protected int numberOfServices;
	
	/** The duration of services*/
	protected int duration;
	
	/** The start date. */
	//protected Date startDate;
	
	/** The service tax entity. */
	protected Tax serviceTax;
	
	/**
	 * *********************************************Default Ctor***************************************************.
	 */
	/**
	 * Instantiates a new service product.
	 */
	public ServiceProduct()
	{
		super();
		serviceTax=new Tax();
	}
	
	
	/**
	 * *********************************************Getter/Setter***************************************************.
	 *
	 * @return the duration
	 */
	/**
	 * Sets the no of service.
	 *
	 * @param noOfService the new no of service
	 */
	
	@TableAnnotation(ColType = FormTypes.NUMBERTEXTCELL, colNo = 6, isFieldUpdater = false, isSortable = true, title = "Duration")
	public Integer getDuration() {
		return duration;
	}
	
	/**
	 * Sets the duration.
	 *
	 * @param duration the new duration
	 */
	public void setDuration(int duration) {
		this.duration = duration;
	}

	/**
	 * Gets the number of service.
	 *
	 * @return the number of service
	 */
	@TableAnnotation(ColType = FormTypes.NUMBERTEXTCELL, colNo = 7, isFieldUpdater = false, isSortable = true, title = "No of Services")
	public Integer getNumberOfServices() {
		return numberOfServices;
	}

	/**
	 * Sets the number of services.
	 *
	 * @param numberOfService the new number of services
	 */
	public void setNumberOfServices(int numberOfService) {
		this.numberOfServices = numberOfService;
	}

	/**
	 * Gets the service tax.
	 *
	 * @return the service tax
	 */
	@TableAnnotation(ColType = FormTypes.TEXTCOLUM, colNo = 8, isFieldUpdater = false, isSortable = false, title = "Service Tax")
	public Tax getServiceTax() {
		return serviceTax;
	}

	/**
	 * Sets the service tax.
	 *
	 * @param serviceTax the new service tax
	 */
	public void setServiceTax(Tax serviceTax) {
		this.serviceTax = serviceTax;
	}
	
	/**
	 * ************************************************Relation Managment Part*********************************************.
	 */
	
	@OnSave
	@GwtIncompatible
	public void OnSave()
	{
		
			super.onSave();
			
		
	}
	
	/**
	 * On load.
	 */
	@OnLoad
	@GwtIncompatible
	public void OnLoad()
	{
		super.onLoad();
	}


	public void setNumberOfService(Integer val1) {
		this.numberOfServices=val1;
		
	}
	
	/**********************************************************************************************************************/

}





